package com.zjitc.service.impl;

import com.zjitc.dao.ManageDao;
import com.zjitc.model.Cart;
import com.zjitc.model.Cat;
import com.zjitc.model.User;
import com.zjitc.service.ManageService;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/23 13:30
 * @description:
 */
@Service
public class ManageServiceImpl implements ManageService {


    @Autowired
    private ManageDao manageDao;

    @Override
    public List<User> findAllUser() {

        return manageDao.findAllUser();
    }

    @Override
    public List<Cat> findAllCat() {
        return manageDao.findAllCat();
    }

    @Override
    public void deleteUser(Integer id) {
        manageDao.deleteUser(id);
    }

    @Override
    public void deleteCat(Integer id) {
        manageDao.deleteCat(id);
    }

    @Override
    public void updateUser() {
        manageDao.updateUser();
    }

    @Override
    public void updateCat() {
        manageDao.updateCat();
    }

    @Override
    public User insertUser() {
        return manageDao.insertUser();
    }

    @Override
    public Cat insertCat() {
        return manageDao.insertCat();
    }

    @Override
    public List findCatByCatSpecies(String catSpecies) {
        return manageDao.findCatByCatSpecies(catSpecies);
    }

    @Override
    public User manageLogin(String username, String password) {
        return manageDao.manageLogin(username, password);
    }

    @Override
    public int checkUser(String username) {
        return manageDao.checkUser(username);
    }

    @Override
    public User checkByUsernameAndPassword(String username) {
        return manageDao.checkByUsernameAndPassword(username);
    }

    @Override
    public User findUserInfo(String username) {
        return manageDao.findUserInfo(username);
    }

    @Override
    public void editManage(String username, String email, String phone) {
        manageDao.editManage(username, email, phone);
    }

    @Override
    public User checkOldPwd(String password) {
        return manageDao.checkOldPwd(password);
    }

    @Override
    public void changePwd(String newPassword, String username) {
        manageDao.changePwd(newPassword, username);
    }

    @Override
    public Cat findCatById(Integer id) {
        return manageDao.findCatById(id);
    }

    @Override
    public void editCat(String catName, String sex, String catSpecies, String image, int id) {
        manageDao.editCat(catName,sex,catSpecies,image,id);
    }

  @Override
  public List<Cart> findAllcartOrder() {
    return manageDao.findAllcartOrder();
  }

  @Override
  public int checkOrderState(String username) {
    return manageDao.checkOrderState(username);
  }

  @Override
  public String UserById(Integer id) {
    return manageDao.findUserById(id);
  }

  @Override
  public void changeState(String uuid) {
     manageDao.changeState(uuid);
  }
}
